﻿using DataModels.Dto;
using DataModels.Dto.House;
using Microsoft.AspNetCore.Mvc;
using Services.House;
using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;

namespace PropertyManagementWebApi.Controllers.Hosue
{
    public class HouseController(HouseService houseservice) : BaseController
    {
        protected HouseService _houseService = houseservice;

        /// <summary>
        /// 获取登录人房屋信息
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetHouseInfo()
        {
            //return _houseService.GetHouseInfo();
            return _houseService.GetHouseInfoBySIGE();
        }

        /// <summary>
        /// 获取登录人房屋信息 测试环境
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetHouseInfo_test()
        {
            //return _houseService.GetHouseInfo();
            return _houseService.GetHouseInfoBySIGE_test();
        }

        /// <summary>
        /// 获取房产所有用户信息
        /// </summary>
        /// <param name="HouseId"></param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetHouseUser([Required] Guid HouseUUId)
        {
            return _houseService.GetHouseUser(HouseUUId);
        }

        /// <summary>
        /// 修改登录人房屋信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResponseModel> EditHouseInfo(EditHouseInfo info)
        {
            return await _houseService.EditHouseInfo(info);
        }

        /// <summary>  
        /// 申请房屋/车位认证
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public ResponseModel HouseCertification(HouseCertificationInfo info)
        {
            return _houseService.HouseCertification(info);
        }

        /// <summary>  
        /// 业主邀请成员
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResponseModel> OwnerInvitesMembers(HouseCertificationOwnerInvitesMembersInfo info)
        {
            return await _houseService.OwnerInvitesMembers(info);
        }



    }
}
